package it.application.smoc.List;

import it.application.smoc.CustomWindow;
import it.application.smoc.R;

import java.util.HashMap;

import android.os.Bundle;
import android.content.Intent;
import android.view.Menu;
import android.widget.ImageView;
import android.widget.TextView;

public class DetailView extends CustomWindow {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail_view);
        Intent i = getIntent();
        
        HashMap<String, String> contact= (HashMap<String, String>) i.getSerializableExtra("it.application.smoclist.Lista");
        ImageView thumb_image=(ImageView)findViewById(R.id.foto);
        ImageLoader imageLoader=new ImageLoader(getApplicationContext());
        imageLoader.DisplayImage(contact.get(CustomizedListView.KEY_THUMB_URL), thumb_image);
        
        ((TextView)findViewById(R.id.Nome)).setText(contact.get(CustomizedListView.KEY_NOME));
        ((TextView)findViewById(R.id.Cognome)).setText(contact.get(CustomizedListView.KEY_COGNOME));
        ((TextView)findViewById(R.id.Delegazione)).setText(contact.get(CustomizedListView.KEY_DELEGAZIONE));

        ((TextView)findViewById(R.id.titolo)).setText(contact.get(CustomizedListView.KEY_TITOLO));
        ((TextView)findViewById(R.id.luogo_nascita)).setText(contact.get(CustomizedListView.KEY_LUOGO_NASCITA));
        ((TextView)findViewById(R.id.data_nascita)).setText(contact.get(CustomizedListView.KEY_DATA_NASCITA));
        ((TextView)findViewById(R.id.grado_ordine)).setText(contact.get(CustomizedListView.KEY_GRADO_ORDINE));
        ((TextView)findViewById(R.id.data_decr_dipl)).setText(contact.get(CustomizedListView.KEY_DATA_DECR_DIPL));
        ((TextView)findViewById(R.id.n_diploma)).setText(contact.get(CustomizedListView.KEY_N_DIPLOMA));
        ((TextView)findViewById(R.id.data_prom)).setText(contact.get(CustomizedListView.KEY_DATA_PROM));
        ((TextView)findViewById(R.id.n_diploma2)).setText(contact.get(CustomizedListView.KEY_N_DIPLOMA2));
        ((TextView)findViewById(R.id.indirizzo)).setText(contact.get(CustomizedListView.KEY_INDIRIZZO));
        ((TextView)findViewById(R.id.cap)).setText(contact.get(CustomizedListView.KEY_CAP));
        ((TextView)findViewById(R.id.citta)).setText(contact.get(CustomizedListView.KEY_CITTA));
        ((TextView)findViewById(R.id.prov)).setText(contact.get(CustomizedListView.KEY_PROV));
        ((TextView)findViewById(R.id.tel)).setText(contact.get(CustomizedListView.KEY_TEL));
        ((TextView)findViewById(R.id.cell)).setText(contact.get(CustomizedListView.KEY_CELL));
        ((TextView)findViewById(R.id.email)).setText(contact.get(CustomizedListView.KEY_EMAIL));
        ((TextView)findViewById(R.id.privacy)).setText(contact.get(CustomizedListView.KEY_PRIVACY));
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_detail_view, menu);
        return true;
    }

}